#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from common.readelement import Element
from page_object.webpage import WebPage

login = Element('jzsz/mp/personal_login')


class MpPersonalLoginPage(WebPage):
    """登录类"""
    # def open_loginpage(self):
    #     """打开登录页面"""
    #     self.get_url('http://jzsz.sit.wingconn.com:7716/jzsz-mp-web/#/login')

    def username(self, name):
        """用户名"""
        self.is_click((login['账号输入框']))
        self.input_text(login['账号输入框'  ], name)

    def password(self, pwd):
        """密码"""
        self.input_text(login['密码'], pwd)

    def submit(self):
        """登录"""
        self.is_click(login['登录'])

    def click_me(self):
        """退出登录"""
        self.is_click(login['我的'])

    def login_success(self):
        """验证登录"""
        return self.is_exists(login['编辑'])



